package com.example.project.entity;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.example.project.enums.RoleEnum;
import io.swagger.annotations.ApiModelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.time.LocalDateTime;

import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModel;

import java.time.LocalDateTime;
import java.util.List;

@ApiModel("User 表")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
    private static final long serialVersionUID = -48171478223497164L;
    @ApiModelProperty("用户id")
    private Long id;

    @ApiModelProperty("部门id")
    private Long depId;

    @TableField(exist = false)
    private String departName;

    @ApiModelProperty("用户名")
    private String userName;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("电话")
    private String phone;

    @ApiModelProperty("角色id")
    private RoleEnum role;

    @ApiModelProperty("部门角色（经理、普通员工）")
    private String departRole;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;


    @TableField(exist = false)
    private List<User> children;

}

